package Day_04;
import java.util.Scanner;
public class ExtendTwoDemo {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("Please Enter a Year:");
        int year = scan.nextInt();
        int year_index = ((year%4==0 && year%100!=0) || (year%400==0))?0:1;
        System.out.println("Please Enter a Month:(1-12)");
        int month = scan.nextInt();
        int days = 0;
        switch(month){
            case 1:
            case 3:
            case 5:
            case 7:
            case 8:
            case 10:
            case 12:
                days = 31;
                break;
            case 4:
            case 6:
            case 9:
            case 11:
                days = 30;
                break;
            case 2:
                days = year_index==0?28:27;
        }
        System.out.println(year+"年"+month+"月共有"+days+"天。");

    }
}
